/*
 * Utf8Encoder.h
 *
 *  Created on: 2011-3-19
 *      Author: terry
 */

#ifndef UTF8ENCODER_H_
#define UTF8ENCODER_H_

#include "BasicType.h"
#include <string>
#include "DataBuffer.h"


class Utf8Encoder
{
public:
    Utf8Encoder();
    ~Utf8Encoder();

    const char* gbkToUtf8(const char* text);
    const char* gbkToUtf8(const char* text, size_t length);
    const char* gbkToUtf8(const std::string& text);

    const char* utf8ToGbk(const char* text);
    const char* utf8ToGbk(const char* text, size_t length);
    const char* utf8ToGbk(const std::string& text);

private:
    comn::DataBuffer< char >		m_charBuffer;
	comn::DataBuffer< wchar_t >	m_wcharBuffer;

};


#endif /* UTF8ENCODER_H_ */
